package test3;

public class Demo2 {
    public static void main(String[] args) {
        Triangle triangle=new Triangle(5,6);
        System.out.println("面积为"+triangle.Area(triangle));
    }
}
class Triangle{
    private int base;
    private int height;
    public Triangle(int base,int height){
        this.base=base;
        this.height=height;
    }
    public int Area(Triangle triangle){
        return this.base*this.height;
    }
}
